﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonCertDetail.aspx.cs"
    Inherits="RN.ERP.Web.PersonChange.PersonCertDetail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../Styles/skins/blue/css/style.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/skins/blue/css/style_msg.css" rel="stylesheet" type="text/css" />
    <link rel="Stylesheet" type="text/css" href="../Scripts/ligerUI/skins/Aqua/css/ligerui-all.css" />
    <script src="../Scripts/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../Scripts/iepngfix_tilebg.js"></script>
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.min.js"></script>
    <script type="text/javascript" language="javascript" src="../Scripts/json-data.js"></script>
    <style type="text/css">
        .IE6png
        {
            behavior: url("../Scripts/iepngfix.htc");
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server">
    </asp:ScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgPersonList" LoadingPanelID="gridLoadingPanel">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <input id="hidobjectType" type="hidden" runat="server" value="0" />
    <input id="hdEmpGuid" type="hidden" runat="server" value="" />
    <input id="hdCorpGuid" type="hidden" runat="server" value="" />
    <input id="HdAreaCode" type="hidden" runat="server" value="" />
    <input id="hdName" type="hidden" runat="server" value="" />
    <input id="hdCorpName" type="hidden" runat="server" value="0" />
    <input id="hdManual" type="hidden" runat="server" value="ZGZS" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
            <td width="16" class="title_lbg IE6png">
            </td>
            <td width="24" class="title_t IE6png">
            </td>
            <td width="913" class="title_libg IE6png">
                <asp:Literal ID="lblTitle" runat="server">人员执业手册</asp:Literal>
            </td>
            <td width="17" class="title_rbg IE6png">
            </td>
        </tr>
        <tr>
            <td class="border_lbg IE6png">
                &nbsp;
            </td>
            <td colspan="2">
                <div>
                    <div class="xian">
                        <div class="about_title">
                            人员信息</div>
                        <div class="i-con-cn">
                        </div>
                    </div>
                    <table border="0" width="100%" cellspacing="0" cellpadding="0" class="tab">
                        <tr>
                            <td style="width: 80px;">
                                姓名
                            </td>
                            <td align="left">
                                <a href="javascript:void(0);" id="a_emp">
                                    <asp:Label ID="lblempName" runat="server" ForeColor="#43a9f5"></asp:Label></a>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                企业名称
                            </td>
                            <td align="left">
                                <asp:Label ID="lblCorpName" runat="server"></asp:Label>
                            </td>
                        </tr>
                    </table>
                </div>
                <!--#人员执业手册-->
                <div id="empManual" runat="server">
                    <div class="xian">
                        <div class="about_title" runat="server" id="lblChildTitle">
                            人员执业手册</div>
                        <div class="i-con" id="scBtnDiv" runat="server">
                        </div>
                    </div>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab">
                        <tr>
                            <td width="15%" bgcolor="#f2f2f2">
                                <strong>证书类别</strong>
                            </td>
                            <td width="15%" bgcolor="#f2f2f2">
                                <strong>证书编号</strong>
                            </td>
                            <td width="10%" bgcolor="#f2f2f2">
                                <strong>证书等级</strong>
                            </td>
                            <td width="20%" bgcolor="#f2f2f2">
                                <strong>专业</strong>
                            </td>
                            <td width="15%" bgcolor="#f2f2f2">
                                <strong>签发日期</strong>
                            </td>
                            <td width="15%" bgcolor="#f2f2f2">
                                <strong>审核状态</strong>
                            </td>
                            <td width="8%" bgcolor="#f2f2f2">
                                <strong>操作</strong>
                            </td>
                        </tr>
                        <tbody id="EmpQualitiesSC">
                        </tbody>
                    </table>
                </div>
                <div class="hx_bg">
                </div>
            </td>
            <td class="border_rbg IE6png">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="border_lconer IE6png" headers="17">
                &nbsp;
            </td>
            <td colspan="2" class="border_bottomli IE6png" height="17">
                &nbsp;
            </td>
            <td class="border_rconer IE6png" headers="17">
                &nbsp;
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
<script type="text/javascript">

    $(function () {
        var empguid = $("#<%=hdEmpGuid.ClientID %>").val();
        $("#a_emp").click(function () {
            ShowViewForm(empguid);
        });
    });
    /*打开窗口*/
    function ShowViewForm(empGuid) {
        top.$.ligerDialog.open({ url: "Person/PersonEmpView.aspx?empGuid=" + empGuid + "&opt=2", width: 1080, height: 800, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
        return false;
    }
</script>
<script type="text/javascript">
    /*主函数*/

    $(function () {

        empGuid = $("#<%= hdEmpGuid.ClientID%>").val();
        corpGuid = $("#<%=hdCorpGuid.ClientID %>").val();
        areaCode = $("#<%=HdAreaCode.ClientID %>").val();
        // editStatus = "<%=EditStatus %>";
        manual = $("#<%=hdManual.ClientID %>").val();
        userRole = "<%=UserRole %>";
        if (manual != "") {
            GetEmpQualitiesSC();
        }
    });
    function AddChange(edid) {
        objectType = $("#<%=hidobjectType.ClientID %>").val();
        hdCorpName = $("#<%=hdCorpName.ClientID %>").val();
        hdName = $("#<%=hdName.ClientID %>").val();
        ShowUpForm("../PersonChange/PersonCertChangeInfo.aspx?empGuid=" + empGuid + "&objectType=" + objectType + "&corpName=" + escape(hdCorpName) + "&objectName=" + escape(hdName) + "&objectId=" + edid, 800, 650);
    }

    /*打开添加窗口*/
    function ShowUpForm(u, w, h, win) {
        $.ligerDialog.open({ url: u, width: w, height: h, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
        return false;
    }
    /*关闭窗口执行事件*/
    function OnClientClose(args) {
        var arg = args;
        if (arg) {
            if (arg.Result == 1) {
                return;
            }
            var childWinName = arg.childWinName;
            switch (childWinName) {

                case "CertSC":
                    GetEmpQualitiesSC();
                    break;
            }
        }

    }
    /*加载人员执业手册数据*/
    function GetEmpQualitiesSC() {
        $.getJSON("../Handlers/PsnEmpInfoHandler.ashx", { "action": "QualitieSC", "empGuid": empGuid, "type": manual, "areaCode": areaCode, "rand": Math.random() }, function (data) {
            var innerHTML = "";

            $("#EmpQualitiesSC").empty();
            if (data != null && data.length > 0) {
                var GetCertificateDate = "";
                for (var i = 0, j = data.length; i < j; i++) {
                    var item = data[i];
                    if (item.GetCertificateDate != null && item.GetCertificateDate.length > 10) {
                        GetCertificateDate = item.GetCertificateDate.substring(0, 10);
                    } else {
                        GetCertificateDate = item.GetCertificateDate;
                    }
                    //                    if (item.CertificateName == "总监理工程师代表" && $("#hdcert").val() == "") {
                    //                        $("#hdcert").val(item.EducationGUID);
                    //                    }
                    innerHTML += ' <tr>';
                    innerHTML += '<td>' + item.CertificateName + '</td><td><a onclick="return EmpQualitiesSCView(\'' + item.EducationGUID + '\');" href="javascript:void(0);"><span style="color: #43a9f5">' + item.CertificateCode + '</span></a></td>';
                    innerHTML += '<td>' + item.CLCode + '</td><td>' + item.CSCode + '</td><td>' + GetCertificateDate + '</td><td>' + item.StrFlowCode + '</td>';
                    if (item.FlowCode==null || item.FlowCode.indexOf("1,") >= 0) {
                        innerHTML += '<td><a href="javascript:void(0);" onclick="return AddChange(\'' + item.EducationGUID + '\');"  title="添加"><img src="../images/addicon.jpg" width="17" height="16" /></a></td></tr>';
                    } else {
                        innerHTML += '<td></td></tr>';
                    }
                }
            }
            $("#EmpQualitiesSC").append(innerHTML);
        });
    }
    function EmpQualitiesSCView(educationGUID) {
        top.$.ligerDialog.open({ url: "Person/PersonEmpManual.aspx?opt=2&empGuid=" + empGuid + "&certGuid=" + educationGUID + "&manual=" + manual, width:800,height: 550, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
        //ShowUpForm("Person/PersonEmpManual.aspx?opt=2&empGuid=" + empGuid + "&certGuid=" + educationGUID + "&manual=" + manual, 800, 550);
    }
    /*弹出提示*/
    function OpenAlert(text) {
        $.ligerDialog.warn(text);
        return false;
    }

    function OpenConfirm(text, confirmCallBackFn) {
        $.ligerDialog.confirm(text, '', confirmCallBackFn);
        return false;
    }
    function ChangeOnClose() {
        top.ChildDialogCallBack = "ChangeOnClientClose";
        var oArg = { Result: 1 };
        top.ChildDialogClose(oArg);
    }
</script>
